/*
 * Copyright (c) 2025 Li Auto Inc. and its affiliates
 * Licensed under the Apache License, Version 2.0(the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef CANTRCV_TJA1145_TYPES_H_
#define CANTRCV_TJA1145_TYPES_H_

#include "comstack_types.h"
#include "can_generaltypes.h"
#include "cantrcv_tja1145_cfg.h"

#define CANTRCV_TJA1145_IS_INIT                         1u
# define CANTRCV_TJA1145_E_TRCV_NOT_STANDBY             0x21u
# define CANTRCV_TJA1145_E_TRCV_NOT_NORMAL              0x22u
# define CANTRCV_TJA1145_E_PARAM_TRCV_WAKEUP_MODE       0x23u
# define CANTRCV_TJA1145_E_PARAM_TRCV_OP_MODE           0x24u
# define CANTRCV_TJA1145_E_NO_TRCV_CONTROL              0x40u
# define CANTRCV_TJA1145_OP_MODE_NORMAL                 CANTRCV_TRCVMODE_NORMAL
# define CANTRCV_TJA1145_OP_MODE_STANDBY                CANTRCV_TRCVMODE_STANDBY
# define CANTRCV_TJA1145_OP_MODE_SLEEP                  CANTRCV_TRCVMODE_SLEEP
# define CANTRCV_TJA1145_WU_ENABLE                      CANTRCV_WUMODE_ENABLE
# define CANTRCV_TJA1145_WU_DISABLE                     CANTRCV_WUMODE_DISABLE
# define CANTRCV_TJA1145_WU_CLEAR                       CANTRCV_WUMODE_CLEAR
# define CANTRCV_TJA1145_WU_ERROR                       CANTRCV_WU_ERROR
# define CANTRCV_TJA1145_WU_NOT_SUPPORTED               CANTRCV_WU_NOT_SUPPORTED
# define CANTRCV_WK_BY_BUS                              CANTRCV_WU_BY_BUS
# define CANTRCV_TJA1145_WU_INTERNALLY                  CANTRCV_WU_INTERNALLY
# define CANTRCV_TJA1145_WU_POWER_ON                    CANTRCV_WU_POWER_ON
# define CANTRCV_WK_BY_PIN                              CANTRCV_WU_BY_PIN
# define CANTRCV_TJA1145_WU_BY_SYSERR                   CANTRCV_WU_BY_SYSERR
# define CANTRCV_TJA1145_WAKEUP_NOT_SUPPORTED          0u
# define CANTRCV_TJA1145_WAKEUP_BY_POLLING             1u
# define CANTRCV_TJA1145_WAKEUP_NONE                   CANTRCV_TJA1145_WAKEUP_NOT_SUPPORTED
# define CANTRCV_TJA1145_WAKEUP_POLLING                CANTRCV_TJA1145_WAKEUP_BY_POLLING

typedef struct
{
	uint8 evt_cap_status;
	uint8 trcv_evt_status;
} cantrcv_status_flg_cate;

typedef volatile struct
{
	CanTrcv_TrcvWakeupReasonType wk_reason;
	CanTrcv_TrcvWakeupModeType wk_report;
	cantrcv_status_flg_cate status_flg;
	uint32 req_stat;
	CanTrcv_TrcvModeType now_op_mode;
	boolean pn_support;
	boolean is_pn_support;
	uint8 is_init;
} cantrcv_prob_cate;

#endif /* CANTRCV_TJA1145_TYPES_H_ */
